/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.practica.entidad;

import java.io.Serializable;
import java.util.List;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Mabel
 */
@Entity
@Table(name = "tipo_reg")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TipoReg.findAll", query = "SELECT t FROM TipoReg t"),
    @NamedQuery(name = "TipoReg.findByIdtipoReg", query = "SELECT t FROM TipoReg t WHERE t.idtipoReg = :idtipoReg"),
    @NamedQuery(name = "TipoReg.findByDescripcion", query = "SELECT t FROM TipoReg t WHERE t.descripcion = :descripcion")})
public class TipoReg implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id_tipoReg")
    private String idtipoReg;
    @Column(name = "descripcion")
    private String descripcion;
    @OneToMany(mappedBy = "idTipo")
    private List<Registrador> registradorList;

    public TipoReg() {
    }

    public TipoReg(String idtipoReg) {
        this.idtipoReg = idtipoReg;
    }

    public String getIdtipoReg() {
        return idtipoReg;
    }

    public void setIdtipoReg(String idtipoReg) {
        this.idtipoReg = idtipoReg;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    @XmlTransient
    public List<Registrador> getRegistradorList() {
        return registradorList;
    }

    public void setRegistradorList(List<Registrador> registradorList) {
        this.registradorList = registradorList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idtipoReg != null ? idtipoReg.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TipoReg)) {
            return false;
        }
        TipoReg other = (TipoReg) object;
        if ((this.idtipoReg == null && other.idtipoReg != null) || (this.idtipoReg != null && !this.idtipoReg.equals(other.idtipoReg))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.practica.entidad.TipoReg[ idtipoReg=" + idtipoReg + " ]";
    }
    
}
